using System;
using UnityEngine;

namespace Assets.Scripts.LookAtCamera1
{
    public class LookAtCamera : MonoBehaviour
    {
        public Camera lookAtCamera;

        public bool lookOnlyOnAwake;

        public void Start()
        {
            if (!lookAtCamera)
            {
                lookAtCamera = Camera.main;
            }
            if (lookOnlyOnAwake)
            {
                LookAtCamera1();
            }
        }

        public void Update()
        {
            if (!lookOnlyOnAwake)
            {
                LookAtCamera1();
            }
        }

        public void LookAtCamera1()
        {
            transform.LookAt(lookAtCamera.transform);
        }

        public void Main()
        {
        }
    }
}